package contact.domain;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class DAOAddress extends HibernateDaoSupport{
	
	public DAOAddress(){}
	
	public static DAOAddress createInstance(){
		return new DAOAddress();
	}
	
	public Long create(Address address){
		return (Long) getHibernateTemplate().save(address);
	}
	
	public Address read(Long id){
		return (Address) getHibernateTemplate().find("from Address where id = ?", id).get(0);
	}
	
	public void update(Address address){
		getHibernateTemplate().update(address);
	}
	
	public void delete(Address address){
		getHibernateTemplate().delete(address);
	}
}
